<?php
// using
use \hpnWse\nWp\stBase as stWpBase;

// 问题分类的子目录
$l_Subjects = \hpnApp\fGetAllSubjects();
$l_SubjectsLen = count($l_Subjects);

?>

<?php get_header(); ?>

<!-- 呈现目标 -->
<div id="k_PrstTgt" class="mi_Fp mi_HomeBkgd">
</div>

<!-- 呈现来源 -->
<div id="k_PrstSrc">

	<div id="k_RootPutSrc" class="cnWse_PutSrc" data-wse_bld_wgt="tCscdDragSld"
		data-wse_use_prst_tgt="true"
		data-wse_vwpt_vmo="0"  data-wse_vsb_show="0"
		data-wse_edp_rge="128" data-wse_edp="i_Tp" 
		data-wse_edge_strh="i_Vtic" data-wse_edge_strh_scl="1.1"
	>
		<div class="cnWse_PutTgtArea">

			<section class="cnWse_DualMenu">
				<div class="cnWse_Big">
					<?php \hpnApp\fIcldFgmtTmp('NavBar.php') ?>

					<form class="cnWse_PutSrc" data-wse_bld_wgt="tForm"
						data-wse_bind_mdl="Qstn"
						data-wse_cmd_sbmt="sbmt_qstn" data-wse_sbmt_anmt="tBarRing"
					>
						<h1 class="mi_FormHead">医问便知</h1>

						<div class="mi_FormBody">
							<div class="cnWse_PutSrc" data-wse_bld_wgt="tFfld"
								data-wse_name="Fld_question_title" data-wse_bind_mdl="Qstn.title"
							>
								<div class="cnWse_LabIpt cnWse_FlexCtanr">
									<!-- <label class="cnWse_Lab mi_PadTp">标题：</label> -->
									<span class="cnWse_PutSrc cnWse_FlexElmt" data-wse_bld_wgt="tEditBox"
										data-wse_type_ent_next_step0="true" data-wse_evt_cmd="i_TypeEnt=sbmt_qstn"
										data-wse_plchd="标题（最多30字）" data-wse_max_len="30">

										<span class="cnWse_ChaFree" data-wse_show_le="10" style="right: 0; bottom: 100%;">
											<span class="cnWse_Free">还可输入 <strong class="cnWse_Cnt"></strong> 个字</span>
											<span class="cnWse_Excd">超出 <strong class="cnWse_Cnt"></strong> 个字</span>
										</span>
									</span>
								</div>
							</div>

							<div class="cnWse_PutSrc" data-wse_bld_wgt="tFfld"
								data-wse_name="Fld_question_desc" data-wse_bind_mdl="Qstn.desc"
							>
								<div class="cnWse_LabIpt cnWse_FlexCtanr">
									<!-- <label class="cnWse_Lab mi_PadTp">描述：</label> -->
									<span class="cnWse_PutSrc cnWse_FlexElmt" data-wse_bld_wgt="tEditBox"
										data-wse_type_ent_next_step="true" data-wse_max_len="500"
										data-wse_plchd="问题描述" data-wse_tab_mode="0"
									>
										<textarea class="cnWse_Edit" autocomplete="off" spellcheck="false" data-wse_ignr_page_ud="true"></textarea>

										<span class="cnWse_ChaPgrs" style="right: 0; bottom: -15px;">
											<span class="cnWse_Cnt"></span>/<span class="cnWse_Tot"></span>字
										</span>
									</span>
								</div>
							</div>

							<div class="mi_UpldDiv">
								<div class="mi_DivTit">图片（最多三张，每张最大1920×1080）</div>
								<div class="mi_UpldBoxDiv">
									<?php for ($i=0; $i<3; ++$i) : ?>
									<span class="cnWse_PutSrc" data-wse_bld_wgt="tFileUpld" data-wse_cmd="Upld2"
										data-wse_bind_mdl="Qstn.imgs[<?php echo $i ?>]"
										data-wse_api_url="<?php echo \hpnApp\fMakeApiUrl('question', 'upload_image') ?>"
										data-wse_acp="image/*" data-wse_max_dim="1920, 1080"
										data-wse_clip="true">
										<div class="cnWse_PutSrc cnWse_Clip" data-wse_bld_wgt="tClip">
										</div>
									</span>
									<?php endfor ?>
								</div>
							</div>

							<div class="mi_SbmtDiv">
								<span class="cnWse_PutSrc" data-wse_bld_wgt="tBtn" data-wse_name="submit"
									data-wse_evt_cmd="i_Clk=sbmt_qstn" data-wse_tit="提 交"
								>
								</span>
							</div>
						</div>

						<div class="mi_SldCue mi_Anmt_SkipDn">
							<p>参<br>与<br>回<br>答</p>
							<i class="fa fa-angle-double-down"></i>
						</div>

						<?php if (!\hpnApp\fIsMember()) : ?>
						<div class="mi_SignupMask">
							<a href="<?php echo \hpnWse\fApdUrlQry(stWpBase::cToPageUrl('login'), 'tab=signup') ?>" class="mi_Pstn_Cen">十秒注册&nbsp;&nbsp;医问便知！</a>
						</div>
						<?php endif ?>
					</form>
				</div>
				<div class="cnWse_Sml">
					<?php \hpnApp\fIcldFgmtTmp('NavBar.php') ?>
				</div>
			</section>

			<section class="cnWse_PutSrc cnWse_SubDragSld mi_MainSctn cnWse_ClearFix" data-wse_name="k_MainSctn">
				<div class="mi_CenPut">
					<div class="cnWse_PutSrc" data-wse_bld_wgt="tDragSld"
						data-wse_name="k_HrztScrns" data-wse_ignr_mos_whl="true"
						data-wse_hsb_show="0" data-wse_vwpt_hmo="128"
						data-wse_dvd_scrn="i_Hrzt"
						data-wse_evt_cmd="i_Actv=chg_crnt_ctgr"
					>
						<div class="cnWse_PutTgt"></div>

						<div class="cnWse_Hdl cnWse_SldLinks " data-wse_can_drag="true" data-wse_area_cssc="">
							<div class="cnWse_SldLinksArea">
								<?php for ($i=0; $i<$l_SubjectsLen; ++$i) : ?>
								<span class="" data-wse_call="cSldVwptPosToScrn(<?php echo $i ?>)"><?php echo $l_Subjects[$i]->name ?></span>
								<?php endfor ?>
								<span class="cnWse_Cur"></span>
							</div>
							<div class="mi_Mask mi_Lt"></div>
							<div class="mi_Mask mi_Rt"></div>
						</div>

						<div class="cnWse_PutTgtArea">

							<?php for ($i=0; $i<$l_SubjectsLen; ++$i) : 
								$l_CtgrSlug = $l_Subjects[$i]->slug;
							?>
							<div class="cnWse_PutSrc cnWse_Scrn" data-wse_bld_wgt=""
								data-wse_name="<?php echo $l_CtgrSlug ?>"
							>
								<div class="cnWse_PutSrc" data-wse_bld_wgt="tMdlFall"
									data-wse_name="k_MdlFall" data-wse_bind_mdl="Ctgrs.<?php echo $l_CtgrSlug ?>"
									data-wse_acst_actv="k_HrztScrns@<?php echo $l_CtgrSlug ?>"
									data-wse_cmd_apd="apd"
									data-wse_vsb_show="3"
									data-wse_edp_rge="80" data-wse_edp="i_Bm" data-wse_edge_shdw="i_Bm"
								>
									<div class="cnWse_PutTgt"></div>

									<div class="cnWse_Loading">
										<span data-wse_load_anmt="tBarRing"></span>
										<span>正在加载...</span>
									</div>

									<!-- <div class="cnWse_HeadLiCtnt">
									</div> -->

									<ul class="cnWse_List mi_QstnList">
									</ul>

									<div data-wse_tmp_html="true" data-wse_use_for="Data" class="mi_Qstn">
										<h6 class="mi_Hdn">
											<a href="{{guid}}" target="_blank">{{post_title}}</a>
										</h6>
										<div class="mi_Meta">
											<span class="mi_Avatar"><img data-wse_src="{{Ava}}" /></span>
											<span class="mi_AthrName mi_TextOvfl_Elps">{{Athr}}</span>
											<span class="mi_PostDatm">{{WseCall fRdblPostDatm}}</span>
											<!-- <span class="mi_ReadCnt">{{ReadCount}} 次浏览</span> -->
										</div>
										<div class="cnWse_FlexCtanr">
											<div class="cnWse_FlexElmt">
												<p class="mi_Excp">
													{{post_excerpt}}&nbsp;&nbsp;<a href="{{guid}}" target="_blank" class="mi_FullTextLink">&gt;&gt;全文</a>
												</p>
												<div class="mi_Cmts">
													<span><i class="fa fa-thumbs-up"></i>{{Pstv}} 赞</span>
													<span><i class="fa fa-thumbs-down"></i>{{Ngtv}} 踩</span>
													<span><i class="fa fa-commenting"></i>{{comment_count}} 回答</span>
													<span><i class="fa fa-heart"></i>{{Fav}} 收藏</span>
												</div>
											</div>
											<span class="mi_ImgWrap">
												<img data-wse_src="{{Imgs[0]}}" />
											</span>
										</div>
									</div>
								</div>
							</div>
							<?php endfor ?>
						</div>
					</div>

					<div class="mi_SideDiv">
						<?php \hpnApp\fIcldFgmtTmp('SideBar.php') ?>
					</div>
				</div>
			</section>
		</div>
	</div><!-- k_RootPutSrc -->

</div><!-- k_PrstSrc -->

<script type="text/javascript">
	<?php
	echo 'window.g_PageData = {' . PHP_EOL;
	echo 'SbjcSlugs: ['  . PHP_EOL;
	foreach ($l_Subjects as $l_Idx => $l_Ctgr)
	{
		echo '"' . $l_Ctgr->slug . '",'  . PHP_EOL;
	}
	echo ']' . PHP_EOL;
	echo '};';
	?>
</script>

<script type="text/javascript" src="<?php echo site_url() . '/js/Cmn.js' ?>"></script>
<script type="text/javascript" src="<?php echo site_url() . '/js/fp.js' ?>"></script>
	
<?php get_footer(); ?>